package com.ruoyi.system.service.impl.fxImpl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.fx.FxTimeQuantum;
import com.ruoyi.system.mapper.fx.FxTimeQuantumMapper;
import com.ruoyi.system.service.fx.IFxTimeQuantumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 预约时间段Service业务层处理
 *
 * @author ruoyi
 * @date 2025-04-30
 */
@Service
public class FxTimeQuantumServiceImpl implements IFxTimeQuantumService
{
    @Autowired
    private FxTimeQuantumMapper fxTimeQuantumMapper;

    /**
     * 查询预约时间段
     *
     * @param id 预约时间段主键
     * @return 预约时间段
     */
    @Override
    public FxTimeQuantum selectFxTimeQuantumById(Long id)
    {
        return fxTimeQuantumMapper.selectFxTimeQuantumById(id);
    }

    /**
     * 查询预约时间段列表
     *
     * @param fxTimeQuantum 预约时间段
     * @return 预约时间段
     */
    @Override
    public List<FxTimeQuantum> selectFxTimeQuantumList(FxTimeQuantum fxTimeQuantum)
    {
        return fxTimeQuantumMapper.selectFxTimeQuantumList(fxTimeQuantum);
    }

    /**
     * 新增预约时间段
     *
     * @param fxTimeQuantum 预约时间段
     * @return 结果
     */
    @Override
    public int insertFxTimeQuantum(FxTimeQuantum fxTimeQuantum)
    {
        fxTimeQuantum.setCreateTime(DateUtils.getNowDate());
        return fxTimeQuantumMapper.insertFxTimeQuantum(fxTimeQuantum);
    }

    /**
     * 修改预约时间段
     *
     * @param fxTimeQuantum 预约时间段
     * @return 结果
     */
    @Override
    public int updateFxTimeQuantum(FxTimeQuantum fxTimeQuantum)
    {
        fxTimeQuantum.setUpdateTime(DateUtils.getNowDate());
        return fxTimeQuantumMapper.updateFxTimeQuantum(fxTimeQuantum);
    }

    /**
     * 批量删除预约时间段
     *
     * @param ids 需要删除的预约时间段主键
     * @return 结果
     */
    @Override
    public int deleteFxTimeQuantumByIds(Long[] ids)
    {
        return fxTimeQuantumMapper.deleteFxTimeQuantumByIds(ids);
    }

    /**
     * 删除预约时间段信息
     *
     * @param id 预约时间段主键
     * @return 结果
     */
    @Override
    public int deleteFxTimeQuantumById(Long id)
    {
        return fxTimeQuantumMapper.deleteFxTimeQuantumById(id);
    }
}
